<?php 

class UserstatsMatchMode{
	function insertStartStatsForNewMatchModes($steamID){
		$ret = array();
		$DB = new DB();
		$con = $DB->conDB();
		if($steamID > 0){
			$MatchMode = new MatchMode();
			$MatchType = new MatchType();
			
			$all_matchmodes = $MatchMode->getAllMatchModes("MatchModeID",false);
			$all_matchtypes = $MatchType->getAllMatchTypes("MatchTypeID",false);
			
			$elo = $this->calculateFirstElo($stats);

			if(is_array($all_matchmodes) AND count($all_matchmodes)>0){
				$insertValues = "";
				foreach($all_matchmodes as $k_mm => $v_mm){
					if(is_array($all_matchtypes) AND count($all_matchtypes)>0){
						foreach($all_matchtypes as $k_mt => $v_mt){
							if($insertValues != ""){
								$insertValues .= ",";
							}
							$insertValues .= "(NULL, ".$steamID.", ".(int)$v_mt['MatchTypeID'].", ".(int)$v_mm['MatchModeID'].", ".(int)$elo.")";
						}
					}
				}
			}
			$sql = "INSERT INTO UserElo
					VALUES ".$insertValues."
							";
			$DB->select($sql,false);
			//$ret['mm'] = $all_matchmodes;
			//$ret['mt'] = $all_matchtypes;
				
			$ret['sql'] = $sql;
			
			$ret['status'] = true;
		}
		return $ret;
		
	}
}

?>